
/** 
 * A规则 
 * @param obj 
 * @returns 
 */  
function start(obj){           

	var  txZyOne=1;       //退休住院自付1报销比例 
	var  txZyTwo=1;       //退休住院自付2报销比例
	var  txZyAll=0.6;     //退休住院全自付比例
	
	var  txQx1=1;         //退休大病器械自付1报销比例
	var  txQx2=1;         //退休大病器械自付2报销比例
	var  txQxA=0.8;       //退休大病器械全自付报销比例
	
	var  txYw1=1;         //退休大病药物自付1报销比例
	var  txYw2=1;         //退休大病药物自付2报销比例
	var  txYwA=0.7;       //退休大病药物全自付报销比例
	
	var  txMzOne=1;       //退休门急诊自付1报销比例 
	var  txMzTwo=1;       //退休门急诊自付2报销比例
	var  txMzAll=0.3;     //退休门急诊全自付比例
	
	var  txJhOne=0;       //退休计划生育自付1报销比例 
	var  txJhTwo=0;       //退休计划生育自付2报销比例
	var  txJhAll=0;       //退休计划生育全自付比例
	
	var  tOne=0.0;
	var  tThree=0.0;

	var  wkZyOne=0.8;      //在职住院自付1报销比例 
	var  wkZyTwo=0.8;      //在职住院自付2报销比例
	var  wkZyAll=0.6;      //在职住院全自付比例      
	
	var  wkZyOne1=0.9;     //在职住院自付1报销比例 
	var  wkZyTwo1=0.9;     //在职住院自付2报销比例
	var  wkZyAll1=0.6;     //在职住院全自付比例      
	
	var  wkQx1=0.8;          //在职大病器械自付1报销比例
	var  wkQx2=0.8;          //在职大病器械自付2报销比例
	var  wkQxA=0.7;        //在职大病器械全自付报销比例
	
	var  wkYw1=0.8;          //在职大病药物自付1报销比例
	var  wkYw2=0.8;          //在职大病药物自付2报销比例
	var  wkYwA=0.6;        //在职大病药物全自付报销比例
	
	var  wkQxOne=0.9;    
	var  wkQxTwo=0.9;          
	var  wkQxAll=0.7;        
	var  wkYwOne=0.9;          
	var  wkYwTwo=0.9;          
	var  wkYwAll=0.6;        
	
	var  wkMzOne=0.8;      //在职门急诊自付1报销比例 
	var  wkMzTwo=0.8;      //在职门急诊自付2报销比例
	var  wkMzAll=0.3;      //在职门急诊全自付比例                                       
	
	var  wkMzOne1=0.9;     //在职门急诊自付1报销比例 
	var  wkMzTwo1=0.9;     //在职门急诊自付2报销比例
	var  wkMzAll1=0.3;     //在职门急诊全自付比例                                       

	var  wkJhOne=1;        //在职计划生育自付1报销比例 
	var  wkJhTwo=1;        //在职计划生育自付2报销比例
	var  wkJhAll=0;        //在职计划生育全自付比例
	
	var wOne=0.0;         
	var wThree=0.0;

    var user=obj.get("UUser");
    var bxList=obj.get("bxList"); 

    var topValue=obj.get("topValue");
    var midList=obj.get("midList");
    var batMoney=obj.get("batMoney");
    var bao=obj.get("bao");
    var rm=obj.get("rm");     //报销说明的map
      if(rm!=null){
    	 rm=rm.get(user.wkState);
      }
   var flg=obj.get("flg");  //走管理员设置的比列报销
   if(flg!=""&&flg!=null){
	   if(bxList!=null){
		   for(var i=0;i<bxList.size();i++){
			   var v=bxList.get(i);
			   var m=midList.get(i);
			   var bxRatio=v.bxRatio/100.0;
			   var oneRadio=v.oneRadio/100.0;
			   var twoRadio=v.twoRadio/100.0;
			   m.payall=Math.round(parseFloat(v.payAll)*100)*v.bxRatio/10000;
			   m.payone=Math.round(parseFloat(v.payOne)*100)*v.oneRadio/10000;
			   m.paytwo=Math.round(parseFloat(v.payTwo)*100)*v.twoRadio/10000;
			   v.bxCost=Math.round(parseFloat(m.payone)*100+parseFloat(m.paytwo)*100+parseFloat(m.payall)*100)/100.0;
			   v.remark="本次计算公式:"+v.payOne+"*"+oneRadio+"+"+v.payTwo+"*"+twoRadio+"+"+v.payAll+"*"+bxRatio+"="+v.bxCost;
			   m.remark=v.reason+"本次计算公式:"+v.payAll+"*"+bxRatio+"="+m.payall;
			   m.bxSum=v.bxCost;
			   m.bxtype=v.bxType;
			   m.bxDate=new Date();
		   }
		       obj.put("bxList",bxList);
	   }
   }else{
	   if(user.wkState=='在职'){
		   if(bxList!=null){
			   for(var i=0;i<bxList.size();i++){
				   var vb=bxList.get(i);
				   var ml=midList.get(i);
				   if(user.wkYears<=20){
					   if(vb.bxType=="住院"){
						   var top1=topValue.get(vb.bxType);        
						   if(vb.topMoney>0){
							   if(top1>=3000){                               
									  wkZyAll=0;
							   }
								   ml.payone=Math.round((parseFloat(vb.payOne-vb.topMoney))*100*(wkZyOne*100)/10000*100)/100.0+Math.round(parseFloat(vb.topMoney)*100*(0.9*100)/10000*100)/100.0;
								   ml.paytwo=Math.round(parseFloat(vb.payTwo)*100*(0.9*100)/10000*100)/100.0;
								   ml.payall=Math.round(parseFloat(vb.payAll)*100*(wkZyAll*100)/10000*100)/100.0;
								   
								   vb.bxCost=Math.round(parseFloat(ml.payone)*100+parseFloat(ml.paytwo)*100+parseFloat(ml.payall)*100)/100.0;
								   vb.remark="本次报销公式:("+vb.payOne+"-"+vb.topMoney+")*"+wkZyOne+"+("+vb.topMoney+"+"+vb.payTwo+")*"+0.9+"+"+vb.payAll+"*"+wkZyAll+"="+vb.bxCost;
								   ml.remark=rm.get(vb.bxType)+vb.remark+"<br>";
								   
							   if((Math.round(parseFloat(top1)*100+parseFloat(ml.payall)*100+parseFloat(wThree))/100.0)>3000){
								   ml.payall=(3000*100-top1*100-wThree)*100/10000.0;
								   vb.bxCost=Math.round(parseFloat(ml.payone)*100+parseFloat(ml.paytwo)*100+parseFloat(ml.payall)*100)/100.0;                                
								   vb.remark="本次报销公式:("+vb.payOne+"-"+vb.topMoney+")*"+wkZyOne+"+("+vb.topMoney+"+"+vb.payTwo+")*"+0.9+"+"+"(3000-"+top1+"-"+wThree+")="+vb.bxCost+"<br>";
								   ml.remark=rm.get(vb.bxType)+"自费已累计报销:"+top1+",待报销"+wThree/100.0+",本次报销:自付1:"+ml.payone+"自付2:"+ml.paytwo+"自费:"+ml.payall+";"+vb.remark+"<br>";
							   }
							       ml.bxSum=vb.bxCost;
						   }else{
							   if(top1>=3000){                               
									  wkZyAll=0;
							   }
							         ml.payone=Math.round(parseFloat(vb.payOne)*100*(wkZyOne*100)/10000*100)/100.0;
								     ml.paytwo=Math.round(parseFloat(vb.payTwo)*100*(wkZyTwo*100)/10000*100)/100.0;
								     ml.payall=Math.round(parseFloat(vb.payAll)*100*(wkZyAll*100)/10000*100)/100.0;
								                                                                                                                                                                                                                                   
								     vb.bxCost=Math.round(parseFloat(ml.payone)*100+parseFloat(ml.paytwo)*100+parseFloat(ml.payall)*100)/100.0;
								     vb.remark="本次报销公式:"+vb.payOne+"*"+wkZyOne+"+"+vb.payTwo+"*"+wkZyTwo+"+"+vb.payAll+"*"+wkZyAll+"="+vb.bxCost;
								         var one=vb.payOne;
								         var two=vb.payTwo;
								         var all=vb.payAll;
								       if(bao&&batMoney!=null){
								           if(batMoney.get(vb.id+"payOne")!=null&&batMoney.get(vb.id+"payOne")!=""){
								              one=batMoney.get(vb.id+"payOne");
								           }
								           if(batMoney.get(vb.id+"payTwo")!=null&&batMoney.get(vb.id+"payTwo")!=""){
								           	  two=batMoney.get(vb.id+"payTwo");
								           }
								           if(batMoney.get(vb.id+"payAll")!=null&&batMoney.get(vb.id+"payAll")!=""){
								              all=batMoney.get(vb.id+"payAll");
								           }
								           vb.remark="本次报销公式:("+one+")*"+wkZyOne+"+("+two+")*"+wkZyTwo+"+("+all+")*"+wkZyAll+"="+vb.bxCost;
								       }
								     
								     ml.remark=rm.get(vb.bxType)+vb.remark+"<br>";
							   if((Math.round(parseFloat(top1)*100+parseFloat(ml.payall)*100+parseFloat(wThree))/100.0)>3000){
								     ml.payall=(3000*100-top1*100-wThree)*100/10000.0;
								     vb.bxCost=Math.round(parseFloat(ml.payone)*100+parseFloat(ml.paytwo)*100+parseFloat(ml.payall)*100)/100.0;
								       if(top1!=0&&wThree!=0){
									      vb.remark="本次报销公式:("+one+")*"+wkZyOne+"+("+two+")*"+wkZyTwo+"+"+"(3000-"+top1+"-"+wThree/100.0+")="+vb.bxCost+"<br>";
									   }else if(top1==0&&wThree!=0){
									      vb.remark="本次报销公式:("+one+")*"+wkZyOne+"+("+two+")*"+wkZyTwo+"+"+"(3000"+"-"+wThree/100.0+")="+vb.bxCost+"<br>";
									   }else if(top1==0&&wThree==0){
									      vb.remark="本次报销公式:("+one+")*"+wkZyOne+"+("+two+")*"+wkZyTwo+"+"+"3000="+vb.bxCost+"<br>";
									   }else if(top1!=0&&wThree==0){
									      vb.remark="本次报销公式:("+one+")*"+wkZyOne+"+("+two+")*"+wkZyTwo+"+"+"(3000-"+top1+")="+vb.bxCost+"<br>";
									   }
								     ml.remark=rm.get(vb.bxType)+"自费已累计报销:"+top1+",待报销"+wThree/100.0+",本次报销:自付1:"+ml.payone+"自付2:"+ml.paytwo+"自费:"+ml.payall+";"+vb.remark+"<br>";
							   }
							         ml.bxSum=vb.bxCost;
						   }                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
						       wThree+=Math.round(ml.payall*100);
					   }else if(vb.bxType=="门急诊"){
						   var top2=topValue.get(vb.bxType);
						   if(vb.topMoney>0){
						       if(top2>=1000){
								   wkMzAll=0;
							   }
									   
									   ml.payone=Math.round(parseFloat(vb.payOne)*100*(wkMzOne*100)/10000*100)/100.0;
									   ml.paytwo=Math.round(parseFloat(vb.payTwo)*100*(wkMzTwo*100)/10000*100)/100.0;
									   ml.payall=Math.round(parseFloat(vb.payAll)*100*(wkMzAll*100)/10000*100)/100.0;
									   
									   vb.bxCost=Math.round(parseFloat(ml.payone)*100+parseFloat(ml.paytwo)*100+parseFloat(ml.payall)*100)/100.0;
									   vb.remark="本次报销公式:("+vb.payOne+"-"+vb.topMoney+")*"+wkMzOne+"+("+vb.topMoney+"+"+vb.payTwo+")*"+wkMzTwo+"+"+vb.payAll+"*"+wkMzAll+"="+vb.bxCost;
									   ml.remark=rm.get(vb.bxType)+vb.remark+"<br>";
							   if((Math.round(parseFloat(top2)*100+parseFloat(ml.payall)*100+parseFloat(wOne))/100.0)>1000){
									   ml.payall=(1000*100-top2*100-wOne)*100/10000.0;
									   vb.bxCost=Math.round(parseFloat(ml.payone)*100+parseFloat(ml.paytwo)*100+parseFloat(ml.payall)*100)/100.0;
									   vb.remark="本次报销公式:"+vb.payOne+"*"+wkMzOne+"+"+vb.payTwo+"*"+wkMzTwo+"+"+"(1000-"+top2+"-"+wOne/100.0+")="+vb.bxCost+"<br>";
									   ml.remark=rm.get(vb.bxType)+"自费已累计报销:"+top2+",待报销"+wOne/100.0+",本次报销:自付1:"+ml.payone+"自付2:"+ml.paytwo+"自费:"+ml.payall+";"+vb.remark+"<br>";
							   }
									   ml.bxSum=vb.bxCost;
						   }else{
						       if(top2>=1000){
								   wkMzAll=0;
							   }
									   
									   ml.payone=Math.round(parseFloat(vb.payOne)*100*(wkMzOne*100)/10000*100)/100.0;
									   ml.paytwo=Math.round(parseFloat(vb.payTwo)*100*(wkMzTwo*100)/10000*100)/100.0;
									   ml.payall=Math.round(parseFloat(vb.payAll)*100*(wkMzAll*100)/10000*100)/100.0;
									   
									   vb.bxCost=Math.round(parseFloat(ml.payone)*100+parseFloat(ml.paytwo)*100+parseFloat(ml.payall)*100)/100.0;
									   vb.remark="本次报销公式:"+vb.payOne+"*"+wkMzOne+"+"+vb.payTwo+"*"+wkMzTwo+"+"+vb.payAll+"*"+wkMzAll+"="+vb.bxCost;
									   ml.remark=rm.get(vb.bxType)+vb.remark+"<br>";
									     var one=vb.payOne;
								         var two=vb.payTwo;
								         var all=vb.payAll;
									   if(bao&&batMoney!=null){
								           if(batMoney.get(vb.id+"payOne")!=null&&batMoney.get(vb.id+"payOne")!=""){
								              one=batMoney.get(vb.id+"payOne");
								           }
								           if(batMoney.get(vb.id+"payTwo")!=null&&batMoney.get(vb.id+"payTwo")!=""){
								           	  two=batMoney.get(vb.id+"payTwo");
								           }
								           if(batMoney.get(vb.id+"payAll")!=null&&batMoney.get(vb.id+"payAll")!=""){
								              all=batMoney.get(vb.id+"payAll");
								           }
								           vb.remark="本次报销公式:("+one+")*"+wkMzOne+"+("+two+")*"+wkMzTwo+"+("+all+")*"+wkMzAll+"="+vb.bxCost;
								       }
							   if((Math.round(parseFloat(top2)*100+parseFloat(ml.payall)*100+parseFloat(wOne))/100.0)>1000){
									   ml.payall=(1000*100-top2*100-wOne)*100/10000.0;
									   vb.bxCost=Math.round(parseFloat(ml.payone)*100+parseFloat(ml.paytwo)*100+parseFloat(ml.payall)*100)/100.0;
									   if(top2!=0&&wOne!=0){
									      vb.remark="本次报销公式:("+one+")*"+wkMzOne+"+("+two+")*"+wkMzTwo+"+"+"(1000-"+top2+"-"+wOne/100.0+")="+vb.bxCost+"<br>";
									   }else if(top2==0&&wOne!=0){
									     vb.remark="本次报销公式:("+one+")*"+wkMzOne+"+("+two+")*"+wkMzTwo+"+"+"(1000"+"-"+wOne/100.0+")="+vb.bxCost+"<br>";
									   }else if(top1==0&&wOne==0) {
									     vb.remark="本次报销公式:("+one+")*"+wkMzOne+"+("+two+")*"+wkMzTwo+"+"+"1000="+vb.bxCost+"<br>";
									   }else if(top1!=0&&wOne==0){
									   	 vb.remark="本次报销公式:("+one+")*"+wkMzOne+"+("+two+")*"+wkMzTwo+"+"+"(1000-"+top2+")="+vb.bxCost+"<br>";
									   }
									   ml.remark=rm.get(vb.bxType)+"自费已累计报销:"+top2+",待报销"+wOne/100.0+",本次报销:自付1:"+ml.payone+"自付2:"+ml.paytwo+"自费:"+ml.payall+";"+vb.remark+"<br>";
							   }
									   ml.bxSum=vb.bxCost;
						   }
								   wOne+=Math.round(ml.payall*100);
								   
					   }else if(vb.bxType=="计划生育"){
								   ml.payone=Math.round(parseFloat(vb.payOne)*100*(wkJhOne*100)/10000*100)/100.0;
								   ml.paytwo=Math.round(parseFloat(vb.payTwo)*100*(wkJhTwo*100)/10000*100)/100.0;
								   ml.payall=Math.round(parseFloat(vb.payAll)*100*(wkJhAll*100)/10000*100)/100.0;
								   
								   vb.bxCost=Math.round(parseFloat(ml.payone)*100+parseFloat(ml.paytwo)*100+parseFloat(ml.payall)*100)/100.0;
								   vb.remark="本次报销公式:"+vb.payOne+"*"+wkJhOne+"+"+vb.payTwo+"*"+wkJhTwo+"+"+vb.payAll+"*"+wkJhAll+"="+vb.bxCost;
								   var one=vb.payOne;
						           var two=vb.payTwo;
						           var all=vb.payAll;
								   if(bao&&batMoney!=null){
							           if(batMoney.get(vb.id+"payOne")!=null&&batMoney.get(vb.id+"payOne")!=""){
							              one=batMoney.get(vb.id+"payOne");
							           }
							           if(batMoney.get(vb.id+"payTwo")!=null&&batMoney.get(vb.id+"payTwo")!=""){
							           	  two=batMoney.get(vb.id+"payTwo");
							           }
							           if(batMoney.get(vb.id+"payAll")!=null&&batMoney.get(vb.id+"payAll")!=""){
							              all=batMoney.get(vb.id+"payAll");
							           }
							           vb.remark="本次报销公式:("+one+")*"+wkJhOne+"+("+two+")*"+wkJhTwo+"+("+all+")*"+wkJhAll+"="+vb.bxCost;
							       }
								       
								   ml.remark=rm.get(vb.bxType)+vb.remark+"<br>";
								   ml.bxSum=vb.bxCost;
						   
					   }else if(vb.bxType=="大病医疗(药物)"){
					   	           ml.payone=Math.round(parseFloat(vb.payOne)*100*(wkYw1*100)/10000*100)/100.0;
								   ml.paytwo=Math.round(parseFloat(vb.payTwo)*100*(wkYw2*100)/10000*100)/100.0;
								   ml.payall=Math.round(parseFloat(vb.payAll)*100*(wkYwA*100)/10000*100)/100.0;
								   vb.bxCost=Math.round(parseFloat(ml.payone)*100+parseFloat(ml.paytwo)*100+parseFloat(ml.payall)*100)/100.0;
								   vb.remark="本次报销公式:"+vb.payOne+"*"+wkYw1+"+"+vb.payTwo+"*"+wkYw2+"+"+vb.payAll+"*"+wkYwA+"="+vb.bxCost;
								   var one=vb.payOne;
								   var two=vb.payTwo;
								   var all=vb.payAll;
								   if(bao&&batMoney!=null){
							           if(batMoney.get(vb.id+"payOne")!=null&&batMoney.get(vb.id+"payOne")!=""){
							              one=batMoney.get(vb.id+"payOne");
							           }
							           if(batMoney.get(vb.id+"payTwo")!=null&&batMoney.get(vb.id+"payTwo")!=""){
							           	  two=batMoney.get(vb.id+"payTwo");
							           }
							           if(batMoney.get(vb.id+"payAll")!=null&&batMoney.get(vb.id+"payAll")!=""){
							              all=batMoney.get(vb.id+"payAll");
							           }
							            vb.remark="本次报销公式:("+one+")*"+wkYw1+"+("+two+")*"+wkYw2+"+("+all+")*"+wkYwA+"="+vb.bxCost;
							       }
								   ml.remark=rm.get(vb.bxType)+vb.remark+"<br>";
								   ml.bxSum=vb.bxCost;
					   }else if(vb.bxType=="大病医疗(器械)"){
					           	   ml.payone=Math.round(parseFloat(vb.payOne)*100*(wkQx1*100)/10000*100)/100.0;
								   ml.paytwo=Math.round(parseFloat(vb.payTwo)*100*(wkQx2*100)/10000*100)/100.0;
								   ml.payall=Math.round(parseFloat(vb.payAll)*100*(wkQxA*100)/10000*100)/100.0;
								   vb.bxCost=Math.round(parseFloat(ml.payone)*100+parseFloat(ml.paytwo)*100+parseFloat(ml.payall)*100)/100.0;
								   vb.remark="本次报销公式:"+vb.payOne+"*"+wkQx1+"+"+vb.payTwo+"*"+wkQx2+"+"+vb.payAll+"*"+wkQxA+"="+vb.bxCost;
								   var one=vb.payOne;
								   var two=vb.payTwo;
								   var all=vb.payAll;
							       if(bao&&batMoney!=null){
							           if(batMoney.get(vb.id+"payOne")!=null&&batMoney.get(vb.id+"payOne")!=""){
							              one=batMoney.get(vb.id+"payOne");
							           }
							           if(batMoney.get(vb.id+"payTwo")!=null&&batMoney.get(vb.id+"payTwo")!=""){
							           	  two=batMoney.get(vb.id+"payTwo");
							           }
							           if(batMoney.get(vb.id+"payAll")!=null&&batMoney.get(vb.id+"payAll")!=""){
							              all=batMoney.get(vb.id+"payAll");
							           }
							           vb.remark="本次报销公式:("+one+")*"+wkQx1+"+("+two+")*"+wkQx2+"+("+all+")*"+wkQxA+"="+vb.bxCost;
							       }
								   ml.remark=rm.get(vb.bxType)+vb.remark+"<br>";
								   ml.bxSum=vb.bxCost;
					   }
				   }else{
					   if(vb.bxType=="住院"){
						   var top1=topValue.get(vb.bxType);         
						   if(vb.topMoney>0){
							   if(top1>=3000){                               
									  wkZyAll=0;
							   }
								   ml.payone=Math.round((parseFloat(vb.payOne-vb.topMoney))*100*(wkZyOne1*100)/10000*100)/100.0+Math.round(parseFloat(vb.topMoney)*100*(0.9*100)/10000*100)/100.0;
								   ml.paytwo=Math.round(parseFloat(vb.payTwo)*100*(0.9*100)/10000*100)/100.0;
								   ml.payall=Math.round(parseFloat(vb.payAll)*100*(wkZyAll*100)/10000*100)/100.0;
								   
								   vb.bxCost=Math.round(parseFloat(ml.payone)*100+parseFloat(ml.paytwo)*100+parseFloat(ml.payall)*100)/100.0;
								   vb.remark="本次报销公式:("+vb.payOne+"-"+vb.topMoney+")*"+wkZyOne1+"+("+vb.topMoney+"+"+vb.payTwo+")*"+0.9+"+"+vb.payAll+"*+"+wkZyAll1+"="+vb.bxCost;
								   ml.remark=rm.get(vb.bxType)+vb.remark;
							   if((Math.round(parseFloat(top1)*100+parseFloat(ml.payall)*100+parseFloat(wThree))/100.0)>3000){
								   ml.payall=(3000*100-top1*100-wThree)*100/10000.0;
								   vb.bxCost=Math.round(parseFloat(ml.payone)*100+parseFloat(ml.paytwo)*100+parseFloat(ml.payall)*100)/100.0;
								   vb.remark="本次报销公式:("+vb.payOne+"-"+vb.topMoney+")*"+wkZyOne1+"+("+vb.topMoney+"+"+vb.payTwo+")*"+0.9+"+"+"(3000-"+top1+"-"+wThree+")="+vb.bxCost+"<br>";
								   ml.remark=rm.get(vb.bxType)+"自费已累计报销:"+top1+",待报销"+wThree/100.0+",本次报销:自付1:"+ml.payone+"自付2:"+ml.paytwo+"自费:"+ml.payall+";"+vb.remark+"<br>";
							   }
							       ml.bxSum=vb.bxCost;
						   }else{
							   if(top1>=3000){                               
									  wkZyAll=0;
							   }
								   ml.payone=Math.round(parseFloat(vb.payOne)*100*(wkZyOne1*100)/10000*100)/100.0;
								   ml.paytwo=Math.round(parseFloat(vb.payTwo)*100*(wkZyTwo1*100)/10000*100)/100.0;
								   ml.payall=Math.round(parseFloat(vb.payAll)*100*(wkZyAll1*100)/10000*100)/100.0;
								   
								   vb.bxCost=Math.round(parseFloat(ml.payone)*100+parseFloat(ml.paytwo)*100+parseFloat(ml.payall)*100)/100.0;
								   vb.remark="本次报销公式:"+vb.payOne+"*"+wkZyOne1+"+"+vb.payTwo+"*"+wkZyTwo1+"+"+vb.payAll+"*"+wkZyAll1+"="+vb.bxCost;
								   var one=vb.payOne;
								   var two=vb.payTwo;
								   var all=vb.payAll;
							       if(bao&&batMoney!=null){
							           if(batMoney.get(vb.id+"payOne")!=null&&batMoney.get(vb.id+"payOne")!=""){
							              one=batMoney.get(vb.id+"payOne");
							           }
							           if(batMoney.get(vb.id+"payTwo")!=null&&batMoney.get(vb.id+"payTwo")!=""){
							           	  two=batMoney.get(vb.id+"payTwo");
							           }
							           if(batMoney.get(vb.id+"payAll")!=null&&batMoney.get(vb.id+"payAll")!=""){
							              all=batMoney.get(vb.id+"payAll");
							           }
							           vb.remark="本次报销公式:("+one+")*"+wkZyOne1+"+("+two+")*"+wkZyTwo1+"+("+all+")*"+wkZyAll1+"="+vb.bxCost;
							       }
								   
								   ml.remark=rm.get(vb.bxType)+vb.remark+"<br>";
							   if((Math.round(parseFloat(top1)*100+parseFloat(ml.payall)*100+parseFloat(wThree))/100.0)>3000){
								   ml.payall=(3000*100-top1*100-wThree)*100/10000.0;
								   vb.bxCost=Math.round(parseFloat(ml.payone)*100+parseFloat(ml.paytwo)*100+parseFloat(ml.payall)*100)/100.0;
								       if(top1!=0&&wThree!=0){
									      vb.remark="本次报销公式:("+one+")*"+wkZyOne1+"+("+two+")*"+wkZyTwo1+"+"+"(3000-"+top1+"-"+wThree/100.0+")="+vb.bxCost+"<br>";
									   }else if(top1==0&&wThree!=0){
									     vb.remark="本次报销公式:("+one+")*"+wkZyOne1+"+("+two+")*"+wkZyTwo1+"+"+"(3000"+"-"+wThree/100.0+")="+vb.bxCost+"<br>";
									   }else if(top1==0&&wThree==0){
									     vb.remark="本次报销公式:("+one+")*"+wkZyOne1+"+("+two+")*"+wkZyTwo1+"+"+"3000="+vb.bxCost+"<br>";
									   }else if(top1!=0&&wThree==0){
									     vb.remark="本次报销公式:("+one+")*"+wkZyOne1+"+("+two+")*"+wkZyTwo1+"+"+"(3000-"+top1+")="+vb.bxCost+"<br>";
									   }
									   ml.remark=rm.get(vb.bxType)+"自费已累计报销:"+top1+",待报销"+wThree/100.0+",本次报销:自付1:"+ml.payone+"自付2:"+ml.paytwo+"自费:"+ml.payall+";"+vb.remark+"<br>";
							   }
							       ml.bxSum=vb.bxCost;
						   }
						       wThree+=Math.round(ml.payall*100);
					   }else if(vb.bxType=="门急诊"){
						   var top2=topValue.get(vb.bxType);
						   if(vb.topMoney>0){
						   	
						      if(top2>=1000){
								   wkMzAll1=0;
							   }
									
									   ml.payone=Math.round(parseFloat(vb.payOne)*100*(wkMzOne1*100)/10000*100)/100.0;
									   ml.paytwo=Math.round(parseFloat(vb.payTwo)*100*(wkMzTwo1*100)/10000*100)/100.0;
									   ml.payall=Math.round(parseFloat(vb.payAll)*100*(wkMzAll1*100)/10000*100)/100.0;
									   
									   vb.bxCost=Math.round(parseFloat(ml.payone)*100+parseFloat(ml.paytwo)*100+parseFloat(ml.payall)*100)/100.0;
									   vb.remark="本次报销公式:("+vb.payOne+"-"+vb.topMoney+")*"+wkMzOne1+"+("+vb.topMoney+"+"+vb.payTwo+")*"+0.9+"+"+vb.payAll+"*"+wkMzAll1+"="+vb.bxCost;
									   ml.remark=rm.get(vb.bxType)+vb.remark+"<br>";
							   if((Math.round(parseFloat(top2)*100+parseFloat(ml.payall)*100+parseFloat(wOne))/100.0)>1000){
								       ml.payall=(1000*100-top2*100-wOne)*100/10000.0;
									   vb.bxCost=Math.round(parseFloat(ml.payone)*100+parseFloat(ml.paytwo)*100+parseFloat(ml.payall)*100)/100.0;
									   vb.remark="本次报销公式:"+vb.payOne+"*"+wkMzOne1+"+"+vb.payTwo+"*"+wkMzTwo1+"+"+"(1000-"+top2+"-"+wOne/100.0+")="+vb.bxCost+"<br>";
									   ml.remark=rm.get(vb.bxType)+"自费已累计报销:"+top2+",待报销"+wOne/100.0+",本次报销:自付1:"+ml.payone+"自付2:"+ml.paytwo+"自费:"+ml.payall+";"+vb.remark+"<br>";
							   }
							   ml.bxSum=vb.bxCost;
						   }else{
						      if(top2>=1000){
								   wkMzAll1=0;
							   }
									   ml.payone=Math.round(parseFloat(vb.payOne)*100*(wkMzOne1*100)/10000*100)/100.0;
									   ml.paytwo=Math.round(parseFloat(vb.payTwo)*100*(wkMzTwo1*100)/10000*100)/100.0;
									   ml.payall=Math.round(parseFloat(vb.payAll)*100*(wkMzAll1*100)/10000*100)/100.0;
									   
									   vb.bxCost=Math.round(parseFloat(ml.payone)*100+parseFloat(ml.paytwo)*100+parseFloat(ml.payall)*100)/100.0;
									   vb.remark="本次报销公式:"+vb.payOne+"*"+wkMzOne1+"+"+vb.payTwo+"*"+wkMzTwo1+"+"+vb.payAll+"*"+wkMzAll1+"="+vb.bxCost;
									   var one=vb.payOne;
								       var two=vb.payTwo;
								       var all=vb.payAll;
									   if(bao&&batMoney!=null){
								           if(batMoney.get(vb.id+"payOne")!=null&&batMoney.get(vb.id+"payOne")!=""){
								              one=batMoney.get(vb.id+"payOne");
								           }
								           if(batMoney.get(vb.id+"payTwo")!=null&&batMoney.get(vb.id+"payTwo")!=""){
								           	  two=batMoney.get(vb.id+"payTwo");
								           }
								           if(batMoney.get(vb.id+"payAll")!=null&&batMoney.get(vb.id+"payAll")!=""){
								              all=batMoney.get(vb.id+"payAll");
								           }
								           vb.remark="本次报销公式:("+one+")*"+wkMzOne1+"+("+two+")*"+wkMzTwo1+"+("+all+")*"+wkMzAll1+"="+vb.bxCost;
								       }
									   ml.remark=rm.get(vb.bxType)+vb.remark+"<br>";
							   if((Math.round(parseFloat(top2)*100+parseFloat(ml.payall)*100+parseFloat(wOne))/100.0)>1000){
								       ml.payall=(1000*100-top2*100-wOne)*100/10000.0;
									   vb.bxCost=Math.round(parseFloat(ml.payone)*100+parseFloat(ml.paytwo)*100+parseFloat(ml.payall)*100)/100.0;
									   if(top2!=0&&wOne!=0){
									      vb.remark="本次报销公式:("+one+")*"+wkMzOne1+"+("+two+")*"+wkMzTwo1+"+"+"(1000-"+top2+"-"+wOne/100.0+")="+vb.bxCost+"<br>";
									   }else if(top2==0&&wOne!=0){
									     vb.remark="本次报销公式:("+one+")*"+wkMzOne1+"+("+two+")*"+wkMzTwo1+"+"+"(1000"+"-"+wOne/100.0+")="+vb.bxCost+"<br>";
									   }else if(top2==0&&wOne==0){
									     vb.remark="本次报销公式:("+one+")*"+wkMzOne1+"+("+two+")*"+wkMzTwo1+"+"+"(1000)="+vb.bxCost+"<br>";
									   }else if(top2!=0&&wOne==0){
									   	 vb.remark="本次报销公式:("+one+")*"+wkMzOne1+"+("+two+")*"+wkMzTwo1+"+"+"(1000-"+top2+")="+vb.bxCost+"<br>";
									   }
									   
									   ml.remark=rm.get(vb.bxType)+"自费已累计报销:"+top2+",待报销"+wOne/100.0+",本次报销:自付1:"+ml.payone+"自付2:"+ml.paytwo+"自费:"+ml.payall+";"+vb.remark+"<br>";
							   }
							   ml.bxSum=vb.bxCost;
						   }
						
						   wOne+=Math.round(ml.payall*100);
					   }else if(vb.bxType=="计划生育"){
							   ml.payone=Math.round(parseFloat(vb.payOne)*100*(wkJhOne*100)/10000*100)/100.0;
							   ml.paytwo=Math.round(parseFloat(vb.payTwo)*100*(wkJhTwo*100)/10000*100)/100.0;
							   ml.payall=Math.round(parseFloat(vb.payAll)*100*(wkJhAll*100)/10000*100)/100.0;
							   vb.bxCost=Math.round(parseFloat(ml.payone)*100+parseFloat(ml.paytwo)*100+parseFloat(ml.payall)*100)/100.0;
							   vb.remark="本次报销公式:"+vb.payOne+"*"+wkJhOne+"+"+vb.payTwo+"*"+wkJhTwo+"+"+vb.payAll+"*"+wkJhAll+"="+vb.bxCost;
							   var one=vb.payOne;
							   var two=vb.payTwo;
							   var all=vb.payAll;
							   if(bao&&batMoney!=null){
						           if(batMoney.get(vb.id+"payOne")!=null&&batMoney.get(vb.id+"payOne")!=""){
						              one=batMoney.get(vb.id+"payOne");
						           }
						           if(batMoney.get(vb.id+"payTwo")!=null&&batMoney.get(vb.id+"payTwo")!=""){
						           	  two=batMoney.get(vb.id+"payTwo");
						           }
						           if(batMoney.get(vb.id+"payAll")!=null&&batMoney.get(vb.id+"payAll")!=""){
						              all=batMoney.get(vb.id+"payAll");
						           }
						           vb.remark="本次报销公式:("+one+")*"+wkJhOne+"+("+two+")*"+wkJhTwo+"+("+all+")*"+wkJhAll+"="+vb.bxCost;
						       }
							   ml.remark=rm.get(vb.bxType)+vb.remark+"<br>";
							   ml.bxSum=vb.bxCost;
					   }else if(vb.bxType=="大病医疗(药物)"){
					   	       ml.payone=Math.round(parseFloat(vb.payOne)*100*(wkYwOne*100)/10000*100)/100.0;
							   ml.paytwo=Math.round(parseFloat(vb.payTwo)*100*(wkYwTwo*100)/10000*100)/100.0;
                               ml.payall=Math.round(parseFloat(vb.payAll)*100*(wkYwAll*100)/10000*100)/100.0;							   
                               vb.bxCost=Math.round(parseFloat(ml.payone)*100+parseFloat(ml.paytwo)*100+parseFloat(ml.payall)*100)/100.0;
                               vb.remark="本次报销公式:"+vb.payOne+"*"+wkYwOne+"+"+vb.payTwo+"*"+wkYwTwo+"+"+vb.payAll+"*"+wkYwAll+"="+vb.bxCost;
							   var one=vb.payOne;
							   var two=vb.payTwo;
							   var all=vb.payAll;
						       if(bao&&batMoney!=null){
						           if(batMoney.get(vb.id+"payOne")!=null&&batMoney.get(vb.id+"payOne")!=""){
						              one=batMoney.get(vb.id+"payOne");
						           }
						           if(batMoney.get(vb.id+"payTwo")!=null&&batMoney.get(vb.id+"payTwo")!=""){
						           	  two=batMoney.get(vb.id+"payTwo");
						           }
						           if(batMoney.get(vb.id+"payAll")!=null&&batMoney.get(vb.id+"payAll")!=""){
						              all=batMoney.get(vb.id+"payAll");
						           }
                                   vb.remark="本次报销公式:("+one+")*"+wkYwOne+"+("+two+")*"+wkYwTwo+"+("+all+")*"+wkYwAll+"="+vb.bxCost;						       
                               }
							   ml.remark=rm.get(vb.bxType)+vb.remark+"<br>";
							   ml.bxSum=vb.bxCost;
					   }else if(vb.bxType=="大病医疗(器械)"){
					           ml.payone=Math.round(parseFloat(vb.payOne)*100*(wkQxOne*100)/10000*100)/100.0;
							   ml.paytwo=Math.round(parseFloat(vb.payTwo)*100*(wkQxTwo*100)/10000*100)/100.0;
                               ml.payall=Math.round(parseFloat(vb.payAll)*100*(wkQxAll*100)/10000*100)/100.0;							   
                               vb.bxCost=Math.round(parseFloat(ml.payone)*100+parseFloat(ml.paytwo)*100+parseFloat(ml.payall)*100)/100.0;
                               vb.remark="本次报销公式:"+vb.payOne+"*"+wkQxOne+"+"+vb.payTwo+"*"+wkQxTwo+"+"+vb.payAll+"*"+wkQxAll+"="+vb.bxCost;
							   var one=vb.payOne;
							   var two=vb.payTwo;
							   var all=vb.payAll;
						       if(bao&&batMoney!=null){
						           if(batMoney.get(vb.id+"payOne")!=null&&batMoney.get(vb.id+"payOne")!=""){
						              one=batMoney.get(vb.id+"payOne");
						           }
						           if(batMoney.get(vb.id+"payTwo")!=null&&batMoney.get(vb.id+"payTwo")!=""){
						           	  two=batMoney.get(vb.id+"payTwo");
						           }
						           if(batMoney.get(vb.id+"payAll")!=null&&batMoney.get(vb.id+"payAll")!=""){
						              all=batMoney.get(vb.id+"payAll");
						           }
						           vb.remark="本次报销公式:("+one+")*"+wkQxOne+"+("+two+")*"+wkQxTwo+"+("+all+")*"+wkQxAll+"="+vb.bxCost;	
							   }
							   ml.remark=rm.get(vb.bxType)+vb.remark+"<br>";
							   ml.bxSum=vb.bxCost;
					   }
					     
				   }
				      ml.bxtype=vb.bxType;
				      ml.bxDate=new Date();
			   }
		   }
		   obj.put("bxList",bxList);
		   }
	   else if(user.wkState=='退休'){
	       if(bxList!=null){
			   
			   for(var i=0;i<bxList.size();i++){
			       var vb=bxList.get(i);
				   var ml=midList.get(i);

				   if(vb.bxType=="住院"){
					   var top1=topValue.get(vb.bxType);
					   if(top1>=3000){
						   txZyAll=0;
					   }
					   if(vb.topMoney>0){ 
							   
							   ml.payone=Math.round((parseFloat(vb.payOne)-parseFloat(vb.topMoney))*100*(txZyOne*100)/10000*100)/100.0+Math.round(parseFloat(vb.topMoney)*100*(0.95*100)/10000*100)/100.0;
							   ml.paytwo=Math.round(parseFloat(vb.payTwo)*100*(0.95*100)/10000*100)/100.0;
							   ml.payall=Math.round(parseFloat(vb.payAll)*100*(txZyAll*100)/10000*100)/100.0;
							   
							   vb.bxCost=Math.round(parseFloat(ml.payone)*100+parseFloat(ml.paytwo)*100+parseFloat(ml.payall)*100)/100.0;
						       vb.remark="本次报销公式:("+vb.payOne+"-"+vb.topMoney+")*"+txZyOne+"+"+vb.topMoney+"*"+0.95+"+"+vb.payAll+"*"+txZyAll+"="+vb.bxCost;
						       ml.remark=rm.get(vb.bxType)+vb.remark+"<br>";
						   if((parseFloat(top1)+parseFloat(ml.payall)+parseFloat(tThree))>3000){
							   ml.payall=(3000*100-top1*100-tThree*100)*100/10000.0;
							   vb.bxCost=Math.round(parseFloat(ml.payone)*100+parseFloat(ml.paytwo)*100+parseFloat(ml.payall)*100)/100.0;
							   vb.remark="本次报销公式:("+vb.payOne+"-"+vb.topMoney+")*"+txZyOne+"+("+vb.topMoney+"+"+vb.payTwo+")*"+0.95+"+"+"(3000-"+top1+"-"+tThree+")="+vb.bxCost+"<br>";
							   ml.remark=rm.get(vb.bxType)+"自费已累计报销:"+top1+",待报销"+tThree+",本次报销:自付1:"+ml.payone+"自付2:"+ml.paytwo+"自费:"+ml.payall+";"+vb.remark+"<br>";
						   }
					   }else{
						         ml.payone=Math.round(parseInt(vb.payOne)*100*(txZyOne*100)/10000*100)/100.0;
							     ml.paytwo=Math.round(parseFloat(vb.payTwo)*100*(txZyTwo*100)/10000*100)/100.0;
							     ml.payall=Math.round(parseFloat(vb.payAll)*100*(txZyAll*100)/10000*100)/100.0;
						   
							   vb.bxCost=Math.round(parseFloat(ml.payone)*100+parseFloat(ml.paytwo)*100+parseFloat(ml.payall)*100)/100.0;
							   vb.remark="本次报销公式:"+vb.payOne+"*"+txZyOne+"+"+vb.payTwo+"*"+txZyTwo+"+"+vb.payAll+"*"+txZyAll+"="+vb.bxCost+"<br>";
							       var one=vb.payOne;
								   var two=vb.payTwo;
								   var all=vb.payAll;
							       if(bao&&batMoney!=null){
							           if(batMoney.get(vb.id+"payOne")!=null&&batMoney.get(vb.id+"payOne")!=""){
							              one=batMoney.get(vb.id+"payOne");
							           }
							           if(batMoney.get(vb.id+"payTwo")!=null&&batMoney.get(vb.id+"payTwo")!=""){
							           	  two=batMoney.get(vb.id+"payTwo");
							           }
							           if(batMoney.get(vb.id+"payAll")!=null&&batMoney.get(vb.id+"payAll")!=""){
							              all=batMoney.get(vb.id+"payAll");
							           }
							           vb.remark="本次报销公式:("+one+")*"+txZyOne+"+("+two+")*"+txZyTwo+"+("+all+")*"+txZyAll+"="+vb.bxCost;
							       }
	                           ml.remark=rm.get(vb.bxType)+vb.remark+"<br>";
						   if(Math.round((parseFloat(top1)*100+parseFloat(ml.payall)*100+parseFloat(tThree))/100.0)>3000){
							   ml.payall=(3000*100-top1*100-tThree)*100/10000.0;
							   vb.bxCost=Math.round(parseFloat(ml.payone)*100+parseFloat(ml.paytwo)*100+parseFloat(ml.payall)*100)/100.0;
							   if(top1!=0&&tThree!=0){
							      vb.remark="本次报销公式:("+one+")*"+txZyOne+"+("+two+")*"+txZyTwo+"+"+"(3000-"+top1+"-"+tThree/100.0+")="+vb.bxCost+"<br>";
							   }else if(top1==0&&tThree!=0){
							     vb.remark="本次报销公式:("+one+")*"+txZyOne+"+("+two+")*"+txZyTwo+"+"+"(3000"+"-"+tThree/100.0+")="+vb.bxCost+"<br>";
							   }else {
							     vb.remark="本次报销公式:("+one+")*"+txZyOne+"+("+two+")*"+txZyTwo+"+"+"3000="+vb.bxCost+"<br>";
							   }
							   ml.remark=rm.get(vb.bxType)+"自费已累计报销:"+top1+",待报销"+tThree/100.0+",本次报销:自付1:"+ml.payone+"自付2:"+ml.paytwo+"自费:"+ml.payall+";"+vb.remark+"<br>";
						   }
					   }
							   ml.bxSum=vb.bxCost;
							   tThree+=Math.round(ml.payall*100);
				   }else if(vb.bxType=="门急诊"){
					   var top2=topValue.get(vb.bxType);
					   if(top2>=1000){
						   txMzAll=0;
					   }
					   if(vb.topMoney>0){
							   ml.payone=Math.round((parseFloat(vb.payOne)-parseFloat(vb.topMoney))*100*(txMzOne*100)/10000*100)/100.0+Math.round(parseFloat(vb.topMoney)*100*(0.95*100)/10000*100)/100.0;
							   ml.paytwo=Math.round(parseFloat(vb.payTwo)*100*(0.95*100)/10000*100)/100.0;
							   ml.payall=Math.round(parseFloat(vb.payAll)*100*(txMzAll*100)/10000*100)/100.0;
							   
							   vb.bxCost=Math.round(parseFloat(ml.payone)*100+parseFloat(ml.paytwo)*100+parseFloat(ml.payall)*100)/100.0;
							   vb.remark="本次报销公式:("+vb.payOne+"-"+vb.topMoney+")*"+txMzOne+"+"+vb.topMoney+"*"+0.95+"+"+vb.payAll+"*"+txMzAll+"="+vb.bxCost;
							   ml.remark=rm.get(vb.bxType)+vb.remark+"<br>";
							   
							   if((Math.round(parseFloat(top2)*100+parseFloat(ml.payall)*100+parseFloat(tOne)*100)/100.0)>1000){
								   ml.payall=(1000*100-top2*100-tOne*100)*100/10000.0;
								   vb.bxCost=Math.round(parseFloat(ml.payone)*100+parseFloat(ml.paytwo)*100+parseFloat(ml.payall)*100)/100.0;
								   vb.remark="本次报销公式:("+vb.payOne+"-"+vb.topMoney+")*"+txMzOne+"+"+vb.topMoney+"*"+0.95+"(1000-"+top2+"-"+tOne+")="+vb.bxCost+"<br>";
								   ml.remark=rm.get(vb.bxType)+"自费已累计报销:"+top2+",待报销"+tOne+",本次报销:自付1:"+ml.payone+"自付2:"+ml.paytwo+"自费:"+ml.payall+";"+vb.remark+"<br>";
							   }
					   }else{
							   ml.payone=Math.round(parseFloat(vb.payOne)*100*(txMzOne*100)/10000*100)/100.0;
							   ml.paytwo=Math.round(parseFloat(vb.payTwo)*100*(txMzTwo*100)/10000*100)/100.0;
							   ml.payall=Math.round(parseFloat(vb.payAll)*100*(txMzAll*100)/10000*100)/100.0;
							   
							   vb.bxCost=Math.round(parseFloat(ml.payone)*100+parseFloat(ml.paytwo)*100+parseFloat(ml.payall)*100)/100.0;
							   vb.remark="本次报销公式:"+vb.payOne+"*"+txMzOne+"+"+vb.payTwo+"*"+txMzTwo+"+"+vb.payAll+"*"+txMzAll+"="+vb.bxCost+"<br>";
							       var one=vb.payOne;
								   var two=vb.payTwo;
								   var all=vb.payAll;
							       if(bao&&batMoney!=null){
							           if(batMoney.get(vb.id+"payOne")!=null&&batMoney.get(vb.id+"payOne")!=""){
							              one=batMoney.get(vb.id+"payOne");
							           }
							           if(batMoney.get(vb.id+"payTwo")!=null&&batMoney.get(vb.id+"payTwo")!=""){
							           	  two=batMoney.get(vb.id+"payTwo");
							           }
							           if(batMoney.get(vb.id+"payAll")!=null&&batMoney.get(vb.id+"payAll")!=""){
							              all=batMoney.get(vb.id+"payAll");
							           }
							           vb.remark="本次报销公式:("+one+")*"+txMzOne+"+("+two+")*"+txMzTwo+"+("+all+")*"+txMzAll+"="+vb.bxCost;
							       }
							   ml.remark=rm.get(vb.bxType)+vb.remark+"<br>";
							   
							   if(Math.round((parseFloat(top2)*100+parseFloat(ml.payall)*100+parseFloat(tOne))/100.0)>1000){
								   ml.payall=(1000*100-top2*100-tOne)*100/10000.0;
								   vb.bxCost=Math.round(parseFloat(ml.payone)*100+parseFloat(ml.paytwo)*100+parseFloat(ml.payall)*100)/100.0;
								   if(top2!=0&&tOne!=0){
								      vb.remark="本次报销公式:("+one+")*"+txZyOne+"+("+two+")*"+txZyTwo+"+"+"(1000-"+top2+"-"+tOne/100.0+")="+vb.bxCost+"<br>";
								   }else if(top2==0&&tOne!=0){
								     vb.remark="本次报销公式:("+one+")*"+txZyOne+"+("+two+")*"+txZyTwo+"+"+"(1000"+"-"+tOne/100.0+")="+vb.bxCost+"<br>";
								   }else if(top2==0&&tOne==0){
								     vb.remark="本次报销公式:("+one+")*"+txZyOne+"+("+two+")*"+txZyTwo+"+"+"1000="+vb.bxCost+"<br>";
								   }else if(top2!=0&&wOne==0){
								   	 vb.remark="本次报销公式:("+one+")*"+txZyOne+"+("+two+")*"+txZyTwo+"+"+"(1000-"+top2+")="+vb.bxCost+"<br>";
								   }
								   ml.remark=rm.get(vb.bxType)+"自费已累计报销:"+top2+",待报销"+tOne/100.0+",本次报销:自付1:"+ml.payone+"自付2:"+ml.paytwo+"自费:"+ml.payall+";"+vb.remark+"<br>";
							   }
					   }
							   ml.bxSum=vb.bxCost;
							   tOne+=Math.round(ml.payall*100);
				   }else if(vb.bxType=="计划生育"){
							   ml.payone=Math.round(parseInt(vb.payOne)*100*(txJhOne*100)/10000*100)/100.0;
							   ml.paytwo=Math.round(parseFloat(vb.payTwo)*100*(txJhTwo*100)/10000*100)/100.0;
							   ml.payall=Math.round(parseFloat(vb.payAll)*100*(txJhAll*100)/10000*100)/100.0;
							   vb.bxCost=Math.round(parseFloat(ml.payone)*100+parseFloat(ml.paytwo)*100+parseFloat(ml.payall)*100)/100.0;
							   vb.remark="本次报销公式:"+vb.payOne+"*"+txJhOne+"+"+vb.payTwo+"*"+txJhTwo+"+"+vb.payAll+"*"+txJhAll+"="+vb.bxCost;
							   ml.remark=rm.get(vb.bxType)+vb.remark+"<br>";
							   ml.bxSum=vb.bxCost;
				   }else if(vb.bxType=="大病医疗(器械)"){
				   	           ml.payone=Math.round(parseFloat(vb.payOne)*100*(txQx1*100)/10000*100)/100.0;
							   ml.paytwo=Math.round(parseFloat(vb.payTwo)*100*(txQx2*100)/10000*100)/100.0;
							   ml.payall=Math.round(parseFloat(vb.payAll)*100*(txQxA*100)/10000*100)/100.0;
							   vb.bxCost=Math.round(parseFloat(ml.payone)*100+parseFloat(ml.paytwo)*100+parseFloat(ml.payall)*100)/100.0;
							   vb.remark="本次报销公式:"+vb.payOne+"*"+txQx1+"+"+vb.payTwo+"*"+txQx2+"+"+vb.payAll+"*"+txQxA+"="+vb.bxCost+"<br>";
						       var one=vb.payOne;
							   var two=vb.payTwo;
							   var all=vb.payAll;
						       if(bao&&batMoney!=null){
						           if(batMoney.get(vb.id+"payOne")!=null&&batMoney.get(vb.id+"payOne")!=""){
						              one=batMoney.get(vb.id+"payOne");
						           }
						           if(batMoney.get(vb.id+"payTwo")!=null&&batMoney.get(vb.id+"payTwo")!=""){
						           	  two=batMoney.get(vb.id+"payTwo");
						           }
						           if(batMoney.get(vb.id+"payAll")!=null&&batMoney.get(vb.id+"payAll")!=""){
						              all=batMoney.get(vb.id+"payAll");
						           }
						           vb.remark="本次报销公式:("+one+")*"+txQx1+"+("+two+")*"+txQx2+"+("+all+")*"+txQxA+"="+vb.bxCost;
						       }
							   ml.remark=rm.get(vb.bxType)+vb.remark+"<br>";
							   ml.bxSum=vb.bxCost;
				   }else if(vb.bxType=="大病医疗(药物)"){
							   ml.payone=Math.round(parseFloat(vb.payOne)*100*(txYw1*100)/10000*100)/100.0;
							   ml.paytwo=Math.round(parseFloat(vb.payTwo)*100*(txYw2*100)/10000*100)/100.0;
							   ml.payall=Math.round(parseFloat(vb.payAll)*100*(txYwA*100)/10000*100)/100.0;
							   vb.bxCost=Math.round(parseFloat(ml.payone)*100+parseFloat(ml.paytwo)*100+parseFloat(ml.payall)*100)/100.0;
							   vb.remark="本次报销公式:"+vb.payOne+"*"+txYw1+"+"+vb.payTwo+"*"+txYw2+"+"+vb.payAll+"*"+txYwA+"="+vb.bxCost+"<br>";
							   var one=vb.payOne;
							   var two=vb.payTwo;
							   var all=vb.payAll;
						       if(bao&&batMoney!=null){
						           if(batMoney.get(vb.id+"payOne")!=null&&batMoney.get(vb.id+"payOne")!=""){
						              one=batMoney.get(vb.id+"payOne");
						           }
						           if(batMoney.get(vb.id+"payTwo")!=null&&batMoney.get(vb.id+"payTwo")!=""){
						           	  two=batMoney.get(vb.id+"payTwo");
						           }
						           if(batMoney.get(vb.id+"payAll")!=null&&batMoney.get(vb.id+"payAll")!=""){
						              all=batMoney.get(vb.id+"payAll");
						           }
						           vb.remark="本次报销公式:("+one+")*"+txYw1+"+("+two+")*"+txYw2+"+("+all+")*"+txYwA+"="+vb.bxCost;
						       }
							   ml.remark=rm.get(vb.bxType)+vb.remark+"<br>";
							   ml.bxSum=vb.bxCost;
				   }	
				     ml.bxtype=vb.bxType;
				     ml.bxDate=new Date();
			   }
		   }
	       obj.put("bxList",bxList);
	   }
   }
   return obj;
};


